package com.steak.business.service;

import com.steak.common.domain.dto.PlaceOrderDTO;
import com.steak.common.result.Response;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

import java.lang.reflect.InvocationTargetException;
import java.util.Map;

/**
 * @author 刘牌
 * @date 2022/3/915:03
 */
@LocalTCC
public interface IBusinessService {

    @TwoPhaseBusinessAction(name = "placeOrder",
                            commitMethod = "commitOrder" ,
                            rollbackMethod = "rollbackOrder")
    Response placeOrder(@BusinessActionContextParameter(paramName = "params")Map<String,String> params);

    void commitOrder(BusinessActionContext context);

    void rollbackOrder(BusinessActionContext context);
}
